#ifndef _Enemies_h_
#define _Enemies_h_
#include<d3d9.h>
#include<d3dx9.h>
#include"Koopa.h"
#include"Goomba.h"
#include"Pirana.h"
#include"Object.h"
#include"StaticObjects.h"
#include"DAudio.h"
class NODE_KOOPA
{
public:
	CKoopa *koopa;
	NODE_KOOPA *next;
};
class LIST_KOOPA
{
public:
	NODE_KOOPA *pHead;
	NODE_KOOPA *pTail;
};
class NODE_GOOMBA
{
public:
	CGoomba *goomba;
	NODE_GOOMBA *next;
};
class LIST_GOOMBA
{
public:
	NODE_GOOMBA *pHead;
	NODE_GOOMBA *pTail;
};
class NODE_PIRANA
{
public:
	NODE_PIRANA *next;
	CPirana *pirana;
};
class LIST_PIRANA
{
public:
	NODE_PIRANA *pHead;
	NODE_PIRANA *pTail;
};
void AddGoomba(LIST_GOOMBA &list,CGoomba *goomba);
void AddKoopa(LIST_KOOPA &list,CKoopa *koopa);
void AddPirana(LIST_PIRANA &list,CPirana *pirana);

class CEnemies
{
	int kind;
	float x;
	float y;
public:
	LIST_GOOMBA list_goomba;
	LIST_KOOPA list_koopa;
	LIST_PIRANA list_pirana;
	CKoopa *Koopa;
	CGoomba *Goomba;
	CPirana *Pirana;
	CSound *BePushed_Sound;
	CSound *BeJumped_Sound;
	bool isfired;
	bool ispushed;
	bool ispause;
	CEnemies();
	~CEnemies();
	void GetEnemies(Object object);
	void CreateEnemies();
	void DeleteEnemies();
	int RemoveNodeGoomba(LIST_GOOMBA &list,NODE_GOOMBA *p);
	void RemoveTail(LIST_GOOMBA &list);
	void RemoveHead(LIST_GOOMBA &list);
	void Move(CStaticObjects *StaticObjects,RECT screen);
	void Render(LPD3DXSPRITE sprite,LPDIRECT3DTEXTURE9 image,int time,int xcamara);
	void CollisionWithGoomba(CKoopa *koopa);
	int CollisionWithMario(bool is_star_man,RECT marioRect,int direction);
};
#endif